stylecontext: Handle theme changes for cached styles
authorBenjamin Otte <otte@redhat.com>
Wed, 7 Jan 2015 17:06:59 +0000 (18:06 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 7 Jan 2015 17:06:59 +0000 (18:06 +0100)
We need to clear the cache manually on full revalidates because
_gtk_css_change_for_child() will clear the full revalidation flags.
And then gtk_style_context_update_cache() will not do the right thing
(which is to clear itself).

gtk/gtkstylecontext.c

index eeb30224cb95255f4e70e298a622163f0fdabb7c..4e91e843ee3408dbcbcabe822ac4bd384106bbb2 100644 (file)
@@ -2842,7 +2842,7 @@ gtk_style_context_update_cache (GtkStyleContext  *context,
   GtkCssStyle *parent;
   gpointer key, value;
 
-  if (_gtk_bitmask_is_empty (parent_changes))
+  if (change == 0 && _gtk_bitmask_is_empty (parent_changes))
     return;
 
   priv = context->priv;
@@ -2951,6 +2951,8 @@ _gtk_style_context_validate (GtkStyleContext  *context,
 
       g_object_unref (static_style);
       g_object_unref (style);
+  
+      gtk_style_context_clear_cache (context);
     }
   else
     {